home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2004 July / APC0407D2.iso / workshop / onlineco / files / ImageMagick-6.0.1-Q16-windows-dll.exe / {app} / include / magick / xwindow.h < prev   
Encoding:
C/C++ Source or Header  |  2004-03-24  |  9.6 KB  |  536 lines

  1. /*
  2.   ImageMagick X11 Window Methods.
  3. */
  4. #ifndef _MAGICK_XWINDOW_H
  5. #define _MAGICK_XWINDOW_H
  6.  
  7. #if defined(__cplusplus) || defined(c_plusplus)
  8. extern "C" {
  9. #endif
  10.  
  11. #if defined(HasX11)
  12.  
  13. #include <X11/Xos.h>
  14. #include <X11/Xlib.h>
  15. #include <X11/Xatom.h>
  16. #include <X11/cursorfont.h>
  17. #include <X11/keysym.h>
  18. #include <X11/Xresource.h>
  19. #include <X11/Xutil.h>
  20. #include "magick/quantize.h"
  21.  
  22. #define MaxIconSize  96
  23. #define MaxNumberPens  11
  24. #define MaxNumberFonts  11
  25. #define MaxXWindows  12
  26.  
  27. typedef enum
  28. {
  29.   ForegroundStencil,
  30.   BackgroundStencil,
  31.   OpaqueStencil,
  32.   TransparentStencil
  33. } AnnotationStencil;
  34.  
  35. typedef enum
  36. {
  37.   UndefinedElement,
  38.   PointElement,
  39.   LineElement,
  40.   RectangleElement,
  41.   FillRectangleElement,
  42.   CircleElement,
  43.   FillCircleElement,
  44.   EllipseElement,
  45.   FillEllipseElement,
  46.   PolygonElement,
  47.   FillPolygonElement,
  48.   ColorElement,
  49.   MatteElement,
  50.   TextElement,
  51.   ImageElement
  52. } ElementType;
  53.  
  54. typedef enum
  55. {
  56.   UndefinedColormap,
  57.   PrivateColormap,
  58.   SharedColormap
  59. } XColormapType;
  60.  
  61. typedef struct _XDrawInfo
  62. {
  63.   int
  64.     x,
  65.     y;
  66.  
  67.   unsigned int
  68.     width,
  69.     height;
  70.  
  71.   double
  72.     degrees;
  73.  
  74.   AnnotationStencil
  75.     stencil;
  76.  
  77.   ElementType
  78.     element;
  79.  
  80.   Pixmap
  81.     stipple;
  82.  
  83.   unsigned int
  84.     line_width;
  85.  
  86.   XSegment
  87.     line_info;
  88.  
  89.   unsigned int
  90.     number_coordinates;
  91.  
  92.   RectangleInfo
  93.     rectangle_info;
  94.  
  95.   XPoint
  96.     *coordinate_info;
  97.  
  98.   char
  99.     geometry[MaxTextExtent];
  100. } XDrawInfo;
  101.  
  102. typedef enum
  103. {
  104.   DefaultState = 0x0000,
  105.   EscapeState = 0x0001,
  106.   ExitState = 0x0002,
  107.   FormerImageState = 0x0004,
  108.   ModifierState = 0x0008,
  109.   MontageImageState = 0x0010,
  110.   NextImageState = 0x0020,
  111.   RetainColorsState = 0x0040,
  112.   SuspendTime = 50,
  113.   UpdateConfigurationState = 0x0080,
  114.   UpdateRegionState = 0x0100
  115. } XState;
  116.  
  117. typedef struct _XImportInfo
  118. {
  119.   unsigned int
  120.     frame,
  121.     borders,
  122.     screen,
  123.     descend,
  124.     silent;
  125. } XImportInfo;
  126.  
  127. typedef struct _XAnnotateInfo
  128. {
  129.   int
  130.     x,
  131.     y;
  132.  
  133.   unsigned int
  134.     width,
  135.     height;
  136.  
  137.   double
  138.     degrees;
  139.  
  140.   XFontStruct
  141.     *font_info;
  142.  
  143.   char
  144.     *text;
  145.  
  146.   AnnotationStencil
  147.     stencil;
  148.  
  149.   char
  150.     geometry[MaxTextExtent];
  151.  
  152.   struct _XAnnotateInfo
  153.     *next,
  154.     *previous;
  155. } XAnnotateInfo;
  156.  
  157. typedef struct _XPixelInfo
  158. {
  159.   unsigned long
  160.     colors,
  161.     *pixels;
  162.  
  163.   XColor
  164.     foreground_color,
  165.     background_color,
  166.     border_color,
  167.     matte_color,
  168.     highlight_color,
  169.     shadow_color,
  170.     depth_color,
  171.     trough_color,
  172.     box_color,
  173.     pen_color,
  174.     pen_colors[MaxNumberPens];
  175.  
  176.   GC
  177.     annotate_context,
  178.     highlight_context,
  179.     widget_context;
  180.  
  181.   unsigned short
  182.     box_index,
  183.     pen_index;
  184. } XPixelInfo;
  185.  
  186. typedef struct _XResourceInfo
  187. {
  188.   XrmDatabase
  189.     resource_database;
  190.  
  191.   ImageInfo
  192.     *image_info;
  193.  
  194.   QuantizeInfo
  195.     *quantize_info;
  196.  
  197.   unsigned long
  198.     colors;
  199.  
  200.   unsigned int
  201.     close_server,
  202.     backdrop;
  203.  
  204.   char
  205.     *background_color,
  206.     *border_color;
  207.  
  208.   char
  209.     *client_name;
  210.  
  211.   XColormapType
  212.     colormap;
  213.  
  214.   unsigned int
  215.     border_width,
  216.     color_recovery,
  217.     confirm_exit,
  218.     delay;
  219.  
  220.   char
  221.     *display_gamma;
  222.  
  223.   char
  224.     *font,
  225.     *font_name[MaxNumberFonts],
  226.     *foreground_color;
  227.  
  228.   unsigned int
  229.     display_warnings,
  230.     gamma_correct;
  231.  
  232.   char
  233.     *icon_geometry;
  234.  
  235.   unsigned int
  236.     iconic,
  237.     immutable;
  238.  
  239.   char
  240.     *image_geometry;
  241.  
  242.   char
  243.     *map_type,
  244.     *matte_color,
  245.     *name;
  246.  
  247.   unsigned int
  248.     magnify,
  249.     pause;
  250.  
  251.   char
  252.     *pen_colors[MaxNumberPens];
  253.  
  254.   char
  255.     *text_font,
  256.     *title;
  257.  
  258.   int
  259.     quantum;
  260.  
  261.   unsigned int
  262.     update,
  263.     use_pixmap,
  264.     use_shared_memory;
  265.  
  266.   unsigned long
  267.     undo_cache;
  268.  
  269.   char
  270.     *visual_type,
  271.     *window_group,
  272.     *window_id,
  273.     *write_filename;
  274.  
  275.   Image
  276.     *copy_image;
  277.  
  278.   int
  279.     gravity;
  280.  
  281.   char
  282.     home_directory[MaxTextExtent];
  283. } XResourceInfo;
  284.  
  285. typedef struct _XWindowInfo
  286. {
  287.   Window
  288.     id;
  289.  
  290.   Window
  291.     root;
  292.  
  293.   Visual
  294.     *visual;
  295.  
  296.   unsigned int
  297.     storage_class,
  298.     depth;
  299.  
  300.   XVisualInfo
  301.     *visual_info;
  302.  
  303.   XStandardColormap
  304.     *map_info;
  305.  
  306.   XPixelInfo
  307.     *pixel_info;
  308.  
  309.   XFontStruct
  310.     *font_info;
  311.  
  312.   GC
  313.     annotate_context,
  314.     highlight_context,
  315.     widget_context;
  316.  
  317.   Cursor
  318.     cursor,
  319.     busy_cursor;
  320.  
  321.   char
  322.     *name,
  323.     *geometry,
  324.     *icon_name,
  325.     *icon_geometry,
  326.     *crop_geometry;
  327.  
  328.   unsigned long
  329.     data,
  330.     flags;
  331.  
  332.   int
  333.     x,
  334.     y;
  335.  
  336.   unsigned int
  337.     width,
  338.     height,
  339.     min_width,
  340.     min_height,
  341.     width_inc,
  342.     height_inc,
  343.     border_width,
  344.     use_pixmap,
  345.     immutable,
  346.     shape,
  347.     shared_memory;
  348.  
  349.   int
  350.     screen;
  351.  
  352.   XImage
  353.     *ximage,
  354.     *matte_image;
  355.  
  356.   Pixmap
  357.     highlight_stipple,
  358.     shadow_stipple,
  359.     pixmap,
  360.     *pixmaps,
  361.     matte_pixmap,
  362.     *matte_pixmaps;
  363.  
  364.   XSetWindowAttributes
  365.     attributes;
  366.  
  367.   XWindowChanges
  368.     window_changes;
  369.  
  370.   void
  371.     *segment_info;
  372.  
  373.   unsigned long
  374.     mask;
  375.  
  376.   unsigned int
  377.     orphan,
  378.     mapped,
  379.     stasis;
  380.  
  381.   Image
  382.     *image;
  383.  
  384.   unsigned int
  385.     destroy;
  386. } XWindowInfo;
  387.  
  388. typedef struct _XWindows
  389. {
  390.   Display
  391.     *display;
  392.  
  393.   XStandardColormap
  394.     *map_info,
  395.     *icon_map;
  396.  
  397.   XVisualInfo
  398.     *visual_info,
  399.     *icon_visual;
  400.  
  401.   XPixelInfo
  402.     *pixel_info,
  403.     *icon_pixel;
  404.  
  405.   XFontStruct
  406.     *font_info;
  407.  
  408.   XResourceInfo
  409.     *icon_resources;
  410.  
  411.   XClassHint
  412.     *class_hints;
  413.  
  414.   XWMHints
  415.     *manager_hints;
  416.  
  417.   XWindowInfo
  418.     context,
  419.     group_leader,
  420.     backdrop,
  421.     icon,
  422.     image,
  423.     info,
  424.     magnify,
  425.     pan,
  426.     command,
  427.     widget,
  428.     popup;
  429.  
  430.   Atom
  431.     wm_protocols,
  432.     wm_delete_window,
  433.     wm_take_focus,
  434.     im_protocols,
  435.     im_remote_command,
  436.     im_update_widget,
  437.     im_update_colormap,
  438.     im_former_image,
  439.     im_retain_colors,
  440.     im_next_image,
  441.     im_exit,
  442.     dnd_protocols;
  443. } XWindows;
  444.  
  445. extern MagickExport char
  446.   *XGetResourceClass(XrmDatabase,const char *,const char *,char *),
  447.   *XGetResourceInstance(XrmDatabase,const char *,const char *,const char *),
  448.   *XGetScreenDensity(Display *);
  449.  
  450. extern MagickExport Cursor
  451.   XMakeCursor(Display *,Window,Colormap,char *,char *);
  452.  
  453. extern MagickExport Image
  454.   *XImportImage(const ImageInfo *,XImportInfo *);
  455.  
  456. extern MagickExport int
  457.   XCheckDefineCursor(Display *,Window,Cursor),
  458.   XError(Display *,XErrorEvent *);
  459.  
  460. extern MagickExport unsigned int
  461.   IsTrue(const char *),
  462.   XAnnotateImage(Display *,const XPixelInfo *,XAnnotateInfo *,Image *),
  463.   XDrawImage(Display *,const XPixelInfo *,XDrawInfo *,Image *),
  464.   XGetWindowColor(Display *,XWindows *,char *),
  465.   XMagickMonitor(const char *,const MagickOffsetType,const MagickSizeType,
  466.     ExceptionInfo *),
  467.   XMakeImage(Display *,const XResourceInfo *,XWindowInfo *,Image *,unsigned int,
  468.     unsigned int),
  469.   XQueryColorDatabase(const char *,XColor *),
  470.   XRemoteCommand(Display *,const char *,const char *);
  471.  
  472. extern MagickExport void
  473.   DestroyXResources(void),
  474.   XBestIconSize(Display *,XWindowInfo *,Image *),
  475.   XBestPixel(Display *,const Colormap,XColor *,unsigned int,XColor *),
  476.   XCheckRefreshWindows(Display *,XWindows *),
  477.   XClientMessage(Display *,const Window,const Atom,const Atom,const Time),
  478.   XConfigureImageColormap(Display *,XResourceInfo *,XWindows *,Image *),
  479.   XConstrainWindowPosition(Display *,XWindowInfo *),
  480.   XDelay(Display *,const unsigned long),
  481.   XDestroyResourceInfo(XResourceInfo *),
  482.   XDestroyWindowColors(Display *,Window),
  483.   XDisplayImageInfo(Display *,const XResourceInfo *,XWindows *,Image *,Image *),
  484.   XFreeResources(Display *,XVisualInfo *,XStandardColormap *,XPixelInfo *,
  485.     XFontStruct *,XResourceInfo *,XWindowInfo *),
  486.   XFreeStandardColormap(Display *,const XVisualInfo *,XStandardColormap *,
  487.     XPixelInfo *),
  488.   XHighlightEllipse(Display *,Window,GC,const RectangleInfo *),
  489.   XHighlightLine(Display *,Window,GC,const XSegment *),
  490.   XHighlightRectangle(Display *,Window,GC,const RectangleInfo *),
  491.   XGetAnnotateInfo(XAnnotateInfo *),
  492.   XGetPixelPacket(Display *,const XVisualInfo *,const XStandardColormap *,
  493.     const XResourceInfo *,Image *,XPixelInfo *),
  494.   XGetMapInfo(const XVisualInfo *,const Colormap,XStandardColormap *),
  495.   XGetResourceInfo(XrmDatabase,const char *,XResourceInfo *),
  496.   XGetWindowInfo(Display *,XVisualInfo *,XStandardColormap *,XPixelInfo *,
  497.     XFontStruct *,XResourceInfo *,XWindowInfo *),
  498.   XGetImportInfo(XImportInfo *),
  499.   XMakeMagnifyImage(Display *,XWindows *),
  500.   XMakeStandardColormap(Display *,XVisualInfo *,XResourceInfo *,Image *,
  501.     XStandardColormap *,XPixelInfo *),
  502.   XMakeWindow(Display *,Window,char **,int,XClassHint *,XWMHints *,
  503.     XWindowInfo *),
  504.   XQueryPosition(Display *,const Window,int *,int *),
  505.   XRefreshWindow(Display *,const XWindowInfo *,const XEvent *),
  506.   XRetainWindowColors(Display *,const Window),
  507.   XSetCursorState(Display *,XWindows *,const unsigned int),
  508.   XUserPreferences(XResourceInfo *),
  509.   XWarning(const ExceptionType,const char *,const char *);
  510.  
  511. extern MagickExport Window
  512.   XWindowByID(Display *,const Window,const unsigned long),
  513.   XWindowByName(Display *,const Window,const char *),
  514.   XWindowByProperty(Display *,const Window,const Atom);
  515.  
  516. extern MagickExport XFontStruct
  517.   *XBestFont(Display *,const XResourceInfo *,const unsigned int);
  518.  
  519. extern MagickExport XrmDatabase
  520.   XGetResourceDatabase(Display *,const char *);
  521.  
  522. extern MagickExport XVisualInfo
  523.   *XBestVisualInfo(Display *,XStandardColormap *,XResourceInfo *);
  524.  
  525. extern MagickExport XWindows
  526.   *XInitializeWindows(Display *,XResourceInfo *),
  527.   *XSetWindows(XWindows *);
  528.  
  529. #endif
  530.  
  531. #if defined(__cplusplus) || defined(c_plusplus)
  532. }
  533. #endif
  534.  
  535. #endif
  536.